/*
    评论请求模块
*/

import request from "@/utils/request";

/*  
    获取评论列表
     /app/v1_0/comments
*/

export const getComments = params => {
    return request({
        method: 'GET',
        url: 'v1_0/comments',
        params
    })
}


/*  
    取消对评论或评论回复点赞
      /app/v1_0/comment/likings/:target
*/

export const delCommentLikings = (commentId) => {
    return request({
        method: 'DELETE',
        url: `v1_0/comment/likings/${commentId}`
    })
}

/*  
    对评论或评论回复点赞
     /app/v1_0/comment/likings
*/

export const addCommentsLikings = target => {
    return request({
        method: 'POST',
        url: 'v1_0/comment/likings',
        data:{
            target
        }
    })
}

/* 
    添加评论或者评论回复
     /app/v1_0/comments
*/
export const addComment = data => {
    return request({
        method: 'POST',
        url: 'v1_0/comments',
        data
    })
}




